home *** CD-ROM | disk | FTP | other *** search
/ CD Concept 6 / CD Concept 06.iso / mac / UTILITAIRE / Little Smalltalk v3.1.4 / C Source / Sources / tty.c < prev    next >
Text File  |  1994-05-28  |  2KB  |  77 lines

  1. /*
  2.     Little Smalltalk, version 3
  3.     Written by Tim Budd, January 1989
  4.  
  5.     tty interface routines
  6.     this is used by those systems that have a bare tty interface
  7.     systems using another interface, such as the stdwin interface
  8.     will replace this file with another.
  9. */
  10.  
  11. # include <stdio.h>
  12. # include "env.h"
  13. # include "memory.h"
  14.  
  15. #include "tty.proto.h"
  16.  
  17. #include "tty.proto.h"
  18.  
  19. #include "tty.proto.h"
  20.  
  21. extern boolean parseok;
  22.  
  23. /* report a fatal system error */
  24. noreturn sysError(char *s1, char *s2)
  25. {
  26.     ignore fprintf(stderr,"%s\n%s\n", s1, s2);
  27.     ignore abort();
  28. }
  29.  
  30. /* report a nonfatal system error */
  31. noreturn sysWarn(char *s1, char *s2)
  32. {
  33.     ignore fprintf(stderr,"%s\n%s\n", s1, s2);
  34. }
  35.  
  36. compilWarn(char *selector, char *str1, char *str2)
  37. {
  38.     ignore fprintf(stderr,"compiler warning: Method %s : %s %s\n", 
  39.         selector, str1, str2);
  40. }
  41.  
  42. compilError(char *selector, char *str1, char *str2)
  43. {
  44.     ignore fprintf(stderr,"compiler error: Method %s : %s %s\n", 
  45.         selector, str1, str2);
  46.     parseok = false;
  47. }
  48.  
  49. noreturn dspMethod(char *cp, char *mp)
  50. {
  51.     /*ignore fprintf(stderr,"%s %s\n", cp, mp);*/
  52. }
  53.  
  54. givepause(void)
  55. {    char buffer[80];
  56.  
  57.     ignore fprintf(stderr,"push return to continue\n");
  58.     ignore gets(buffer);
  59. }
  60.  
  61. object sysPrimitive(int number, object *arguments)
  62. {    object returnedObject;
  63.  
  64.         /* someday there will be more here */
  65.     switch(number - 150) {
  66.         case 0:        /* do a system() call */
  67.             returnedObject = newInteger(system(
  68.                 charPtr(arguments[0])));
  69.             break;
  70.  
  71.         default:
  72.             sysError("unknown primitive","sysPrimitive");
  73.         }
  74.     return(returnedObject);
  75. }
  76.  
  77.